/*

Author   : chaos

FileName : dynamic_array.cpp

Date     : 10/08/17 10:07:49

*/
#include <iostream>
using namespace std;

int main(int argc ,char *argv[])
{
    int n,i;

    cout << " Please input the size of array :" << endl;
    cin >> n;

    int (*ptr)[2] = new int [n][2];

    cout << "Please input the value of array :" << endl;

    for(i=0;i<n;i++)
    {
        ptr[i][0] = ptr[i][1] = 5;
        cout << "array [" << i <<"][0] =";
        cin >> ptr[i][0];
        cout << "array [" << i <<"][1] =";
        cin >> ptr[i][1];
    }

    cout << endl << "The result is ... " << endl;

    for(i=0;i<n;i++){
        cout << "array [" << i << "][0] =" << ptr[i][0];

        cout << "\tarray [" << i << "][1] =" << ptr[i][1];

        cout << endl;
    }

    delete [] ptr;
    return 0;
}
